<template>
  <div class="page-container" v-loading="loading" v-loadingCommonStyle>
    <ex_header_spiler :title="$tt('label_base_info')" />

    <ex_super_desc :model="baseOption" :data="form" size="default" direction="vertical" :attrs="$defaultDetailDescAttrs" border
      class="desc_flex_row" labelClassName="flex_cell" contentClassName="flex_cell"></ex_super_desc>

  </div>
</template>
<script>


import router_params from '@/mixin/router_params';

export default {

  title: "label_network_detail",
  mixins: [router_params],
  data() {
    return {
      loading: false,

      form: {},
      baseOption: [

        { key: 'placeCode', label: 'label_network_code', 'min-width': 120, 'show-overflow-tooltip': true, },
        { key: 'placeName', label: 'label_network_name', 'min-width': 140, 'show-overflow-tooltip': true, },
        { key: 'parentPlaceName', label: 'label_network_belong', 'min-width': 120, 'show-overflow-tooltip': true },
        { key: 'serviceOutletCenterName', label: 'label_network_center', 'min-width': 120, 'show-overflow-tooltip': true },
        {
          key: 'serviceOutletHeadOfficeName',
          label: 'label_network_belong_head_office',
          'min-width': 120,
          'show-overflow-tooltip': true
        },
        {
          key: 'serviceOutletMode', label: 'label_network_mode', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "TmsBaseServiceOutletModeEnum")
        },
        {
          key: 'serviceOutletType', label: 'label_network_type', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "TmsBaseServiceOutletTypeEnum")
        },
        {
          key: 'placeLocation', label: 'label_network_position', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "TmsBasePlacePositionEnum")
        },
        { key: 'contacts', label: 'label_srm_supplier_contact_name', 'min-width': 120, 'show-overflow-tooltip': true },
        {
          key: 'contactNumber',
          label: 'label_srm_supplier_contact_phone',
          'min-width': 120,
          'show-overflow-tooltip': true
        },
        { key: 'address', label: 'label_network_address', 'min-width': 120, 'show-overflow-tooltip': true, },
        {
          key: 'serviceRangeRemark',
          label: 'label_service_range_remark',
          'min-width': 120,
          'show-overflow-tooltip': true,
        },
        {
          key: 'serviceOutletHeadOfficeName', label: 'label_belong_headquarters', 'min-width': 120, 'show-overflow-tooltip': true,
        },
        { key: 'financialCenter', label: 'label_financial_center', 'min-width': 120, 'show-overflow-tooltip': true, },
        {
          key: 'distributionCenter',
          label: 'label_distribution_center',
          'min-width': 120,
          'show-overflow-tooltip': true,
        },
        {
          key: 'allowArrivePay', label: 'label_allow_arrive_pay', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "YesOrNoEnum")
        },
        {
          key: 'isPrepayEnabled', label: 'label_pre_pay_enable', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "IsAvailableStatusEnum")
        },
        { key: 'modifier', label: 'label_update_user', 'min-width': 120, 'show-overflow-tooltip': true, },
        {
          key: 'gmtModify', label: 'label_modify_time', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => {
              return this.$dateFormat(v)
            }
        },

      ],
    };
  },

  methods: {
    init_data_default(into_params) {
      if (into_params.id) {
        this.loading = true
        this.$ajax({
          url: "/tms-api/base/TmsServiceOutletRpc/detail.json",
          method: 'post',
          data: { id: into_params.id },
          success: (res) => {
            this.loading = false
            this.form = Object.assign({}, res.data)
            this.fixTabLabel()

          }
        })
      }
      this.fixTabLabel()
    },
    fixTabLabel() {
      this.$emit("tagModifyLabel", "label_network_detail")
    },

  }
};

</script>
<style></style>
